package day28_35.day34;

import java.util.Scanner;

public class Main01 {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        while (scn.hasNext()) {
            int n = scn.nextInt();
            String a = scn.nextLine();
            for (int i = 0; i < n; i++) {
                String b = scn.nextLine();
                if (b.contains(",") || b.contains(" ")) {
                    System.out.print("\"" + b + "\"");
                } else {
                    System.out.print(b);
                }
                if (i != n - 1) {
                    System.out.print(", ");
                }else {
                    System.out.println();
                }
            }

        }
    }
}
